Public Class Grupo

    Private mcodigo As Integer 'codigo con el fin de brindar persistencia
    Private mcursos As New List(Of Curso) 'porque una coleccion?
    Private mprofesores As New List(Of Profesor)
    Private estaCerrado As Boolean
    Private maula As String
    Private mhorario As String
    Private manno As Integer
    Private mnumero As Integer
    Private mcuatrimestre As String
    Private idPlan As Integer 'levantar por demanda el plan
    Private mplanEvaluacion As ComponenteEvaluacion
    Private mlistaEstudiantes As List(Of Estudiante)

    'TODO estos constructores estan oscuros, porque todos en false
    Public Sub New()
        Me.estaCerrado = False

    End Sub
    Public Sub New(ByVal codigo As Integer, ByVal idPlan As Integer)
        Me.estaCerrado = False
        Me.mcodigo = codigo
        Me.idPlan = idPlan
    End Sub
    Public Property Aula() As String
        Get
            Return maula
        End Get
        Set(ByVal Value As String)
            maula = Value
        End Set
    End Property

    Public Property Cursos() As List(Of Curso)
        Get
            Return mcursos
        End Get
        Set(ByVal Value As List(Of Curso))
            mcursos = Value
        End Set
    End Property

    Public Property Profesores() As List(Of Profesor)
        Get
            Return mprofesores
        End Get
        Set(ByVal Value As List(Of Profesor))
            mprofesores = Value
        End Set
    End Property

    Public Property IsCerrado() As Boolean
        Get
            Return estaCerrado
        End Get
        Set(ByVal Value As Boolean)
            estaCerrado = Value
            MultiGrupo.ModificarEstado(Me.mcodigo, Value)
        End Set
    End Property
    Public Property Horario() As String
        Get
            Return mhorario
        End Get
        Set(ByVal Value As String)
            mhorario = Value
        End Set
    End Property

    Public Property NumeroCurso() As Integer
        Get
            Return mnumero
        End Get
        Set(ByVal value As Integer)
            mnumero = value
        End Set
    End Property

    Public Property Cuatrimestre() As String
        Get
            Return mcuatrimestre
        End Get
        Set(ByVal Value As String)
            mcuatrimestre = Value
        End Set
    End Property

    Public Property Anio() As Integer
        Get
            Return manno
        End Get
        Set(ByVal value As Integer)
            manno = value
        End Set
    End Property

    Public Property PlanEvaluacion() As ComponenteEvaluacion
        Get
            If (mplanEvaluacion Is Nothing) Then
                mplanEvaluacion = MultiPlan.LevantarRubrosObj(Me.idPlan)
            End If
            Return mplanEvaluacion
        End Get
        Set(ByVal Value As ComponenteEvaluacion)
            mplanEvaluacion = Value
            MultiPlan.RegistrarPlanPorGrupo(Me.idPlan, Me.mplanEvaluacion)
        End Set
    End Property

    Public Sub AgregarCurso(ByVal pcurso As Curso)
        mcursos.Add(pcurso)
    End Sub

    Public Sub AgregarProfesor(ByVal pprofesor As Profesor)
        mprofesores.Add(pprofesor)
    End Sub

    'Revisar Me.Cursos.ToString y el de profesores, no se sabe q devuelve eso
    Public Overrides Function ToString() As String
        Dim info As String = ""
        'info = Me.Nombre
        info += "" & Me.Cursos.ToString
        info += "" & Me.Profesores.ToString
        Return info
    End Function
End Class
